/*
 * Copyright (c) 2021 Arm Limited.
 *
 * SPDX-License-Identifier: MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#if defined(__aarch64__)

#include <cstddef>
#include <cstdint>

namespace arm_conv {
namespace depthwise {

void a64_fp32_packed_to_nhwc_5x5_s1_with_multiplier_output2x4_mla_depthfirst_impl(
  const float *const *const inptrs,
  float *const *const outptrs,
  const void *params,
  const unsigned int n_output_channels,
  const float activation_min,
  const float activation_max
)
{
  const float minmax_vals[2] = { activation_min, activation_max };

  __asm__ __volatile__(
    "ldp x13, x12, [%x[outptrs], #0x0]\n"
    "add x11, %x[clamps], #0x4\n"
    "ldp x10, x9, [%x[outptrs], #0x10]\n"
    "mov x28, #0x0\n"
    "ldp x27, x26, [%x[outptrs], #0x20]\n"
    "mov x25, #0x0\n"
    "ldp x24, x23, [%x[outptrs], #0x30]\n"
    "lsr x22, %x[channel_multiplier], #0x2\n"
    "ldr x21, [%x[inptrs], #0x0]\n"
    "ldr x20, [%x[inptrs], #0x8]\n"
    "ldr x19, [%x[inptrs], #0x10]\n"
    "ldr q0, [x21, #0x0]\n"
    "ldr q1, [x21, #0x10]\n"
    "ldr q2, [x20, #0x0]\n"
    "ldr q3, [x20, #0x10]\n"
    "ldr q4, [x19, #0x0]\n"
    "ldr q5, [x19, #0x10]\n"
    "ldr x21, [%x[inptrs], #0x18]\n"
    "ldr x20, [%x[inptrs], #0x20]\n"
    "ldr x19, [%x[inptrs], #0x28]\n"
    "ldr q6, [x21, #0x0]\n"
    "ldr q7, [x21, #0x10]\n"
    "ldr q8, [x20, #0x0]\n"
    "ldr q9, [x20, #0x10]\n"
    "ldr q10, [x19, #0x0]\n"
    "ldr q11, [x19, #0x10]\n"
    "ld1r { v21.4s }, [%x[clamps]]\n"
    "ld1r { v20.4s }, [x11]\n"
    "cbz x22, 3f\n"
    "ldr q12, [%x[params], #0x0]\n"
    "mov v13.16b, v12.16b\n"
    "ldr q31, [%x[params], #0x10]\n"
    "subs x22, x22, #0x1\n"
    "mov v14.16b, v12.16b\n"
    "ldr q30, [%x[params], #0x20]\n"
    "mov v15.16b, v12.16b\n"
    "ldr q29, [%x[params], #0x30]\n"
    "mov v16.16b, v12.16b\n"
    "ldr q28, [%x[params], #0x40]\n"
    "mov v17.16b, v12.16b\n"
    "ldr q27, [%x[params], #0x50]\n"
    "add %x[params], %x[params], #0x60\n"
    "mov v18.16b, v12.16b\n"
    "mov v19.16b, v12.16b\n"
    "beq 2f\n"
    "1:"  // Output channel complete vector loop
    "fmla v12.4s, v31.4s, v0.s[0]\n"
    "add x28, x28, #0x4\n"
    "fmla v13.4s, v31.4s, v0.s[1]\n"
    "subs x22, x22, #0x1\n"
    "fmla v14.4s, v31.4s, v0.s[2]\n"
    "fmla v15.4s, v31.4s, v0.s[3]\n"
    "fmla v16.4s, v31.4s, v2.s[0]\n"
    "fmla v17.4s, v31.4s, v2.s[1]\n"
    "fmla v18.4s, v31.4s, v2.s[2]\n"
    "fmla v19.4s, v31.4s, v2.s[3]\n"
    "ldr q31, [%x[params], #0x0]\n"
    "fmla v12.4s, v30.4s, v0.s[1]\n"
    "fmla v13.4s, v30.4s, v0.s[2]\n"
    "fmla v14.4s, v30.4s, v0.s[3]\n"
    "fmla v15.4s, v30.4s, v1.s[0]\n"
    "fmla v16.4s, v30.4s, v2.s[1]\n"
    "fmla v17.4s, v30.4s, v2.s[2]\n"
    "fmla v18.4s, v30.4s, v2.s[3]\n"
    "fmla v19.4s, v30.4s, v3.s[0]\n"
    "ldr q30, [%x[params], #0x10]\n"
    "fmla v12.4s, v29.4s, v0.s[2]\n"
    "fmla v13.4s, v29.4s, v0.s[3]\n"
    "fmla v14.4s, v29.4s, v1.s[0]\n"
    "fmla v15.4s, v29.4s, v1.s[1]\n"
    "fmla v16.4s, v29.4s, v2.s[2]\n"
    "fmla v17.4s, v29.4s, v2.s[3]\n"
    "fmla v18.4s, v29.4s, v3.s[0]\n"
    "fmla v19.4s, v29.4s, v3.s[1]\n"
    "ldr q29, [%x[params], #0x20]\n"
    "fmla v12.4s, v28.4s, v0.s[3]\n"
    "fmla v13.4s, v28.4s, v1.s[0]\n"
    "fmla v14.4s, v28.4s, v1.s[1]\n"
    "fmla v15.4s, v28.4s, v1.s[2]\n"
    "fmla v16.4s, v28.4s, v2.s[3]\n"
    "fmla v17.4s, v28.4s, v3.s[0]\n"
    "fmla v18.4s, v28.4s, v3.s[1]\n"
    "fmla v19.4s, v28.4s, v3.s[2]\n"
    "ldr q28, [%x[params], #0x30]\n"
    "fmla v12.4s, v27.4s, v1.s[0]\n"
    "fmla v13.4s, v27.4s, v1.s[1]\n"
    "fmla v14.4s, v27.4s, v1.s[2]\n"
    "fmla v15.4s, v27.4s, v1.s[3]\n"
    "fmla v16.4s, v27.4s, v3.s[0]\n"
    "fmla v17.4s, v27.4s, v3.s[1]\n"
    "fmla v18.4s, v27.4s, v3.s[2]\n"
    "fmla v19.4s, v27.4s, v3.s[3]\n"
    "ldr q27, [%x[params], #0x40]\n"
    "fmla v12.4s, v31.4s, v2.s[0]\n"
    "fmla v13.4s, v31.4s, v2.s[1]\n"
    "fmla v14.4s, v31.4s, v2.s[2]\n"
    "fmla v15.4s, v31.4s, v2.s[3]\n"
    "fmla v16.4s, v31.4s, v4.s[0]\n"
    "fmla v17.4s, v31.4s, v4.s[1]\n"
    "fmla v18.4s, v31.4s, v4.s[2]\n"
    "fmla v19.4s, v31.4s, v4.s[3]\n"
    "ldr q31, [%x[params], #0x50]\n"
    "fmla v12.4s, v30.4s, v2.s[1]\n"
    "fmla v13.4s, v30.4s, v2.s[2]\n"
    "fmla v14.4s, v30.4s, v2.s[3]\n"
    "fmla v15.4s, v30.4s, v3.s[0]\n"
    "fmla v16.4s, v30.4s, v4.s[1]\n"
    "fmla v17.4s, v30.4s, v4.s[2]\n"
    "fmla v18.4s, v30.4s, v4.s[3]\n"
    "fmla v19.4s, v30.4s, v5.s[0]\n"
    "ldr q30, [%x[params], #0x60]\n"
    "fmla v12.4s, v29.4s, v2.s[2]\n"
    "fmla v13.4s, v29.4s, v2.s[3]\n"
    "fmla v14.4s, v29.4s, v3.s[0]\n"
    "fmla v15.4s, v29.4s, v3.s[1]\n"
    "fmla v16.4s, v29.4s, v4.s[2]\n"
    "fmla v17.4s, v29.4s, v4.s[3]\n"
    "fmla v18.4s, v29.4s, v5.s[0]\n"
    "fmla v19.4s, v29.4s, v5.s[1]\n"
    "ldr q29, [%x[params], #0x70]\n"
    "fmla v12.4s, v28.4s, v2.s[3]\n"
    "fmla v13.4s, v28.4s, v3.s[0]\n"
    "fmla v14.4s, v28.4s, v3.s[1]\n"
    "fmla v15.4s, v28.4s, v3.s[2]\n"
    "fmla v16.4s, v28.4s, v4.s[3]\n"
    "fmla v17.4s, v28.4s, v5.s[0]\n"
    "fmla v18.4s, v28.4s, v5.s[1]\n"
    "fmla v19.4s, v28.4s, v5.s[2]\n"
    "ldr q28, [%x[params], #0x80]\n"
    "fmla v12.4s, v27.4s, v3.s[0]\n"
    "fmla v13.4s, v27.4s, v3.s[1]\n"
    "fmla v14.4s, v27.4s, v3.s[2]\n"
    "fmla v15.4s, v27.4s, v3.s[3]\n"
    "fmla v16.4s, v27.4s, v5.s[0]\n"
    "fmla v17.4s, v27.4s, v5.s[1]\n"
    "fmla v18.4s, v27.4s, v5.s[2]\n"
    "fmla v19.4s, v27.4s, v5.s[3]\n"
    "ldr q27, [%x[params], #0x90]\n"
    "fmla v12.4s, v31.4s, v4.s[0]\n"
    "fmla v13.4s, v31.4s, v4.s[1]\n"
    "fmla v14.4s, v31.4s, v4.s[2]\n"
    "fmla v15.4s, v31.4s, v4.s[3]\n"
    "fmla v16.4s, v31.4s, v6.s[0]\n"
    "fmla v17.4s, v31.4s, v6.s[1]\n"
    "fmla v18.4s, v31.4s, v6.s[2]\n"
    "fmla v19.4s, v31.4s, v6.s[3]\n"
    "ldr q31, [%x[params], #0xa0]\n"
    "fmla v12.4s, v30.4s, v4.s[1]\n"
    "fmla v13.4s, v30.4s, v4.s[2]\n"
    "fmla v14.4s, v30.4s, v4.s[3]\n"
    "fmla v15.4s, v30.4s, v5.s[0]\n"
    "fmla v16.4s, v30.4s, v6.s[1]\n"
    "fmla v17.4s, v30.4s, v6.s[2]\n"
    "fmla v18.4s, v30.4s, v6.s[3]\n"
    "fmla v19.4s, v30.4s, v7.s[0]\n"
    "ldr q30, [%x[params], #0xb0]\n"
    "fmla v12.4s, v29.4s, v4.s[2]\n"
    "fmla v13.4s, v29.4s, v4.s[3]\n"
    "fmla v14.4s, v29.4s, v5.s[0]\n"
    "fmla v15.4s, v29.4s, v5.s[1]\n"
    "fmla v16.4s, v29.4s, v6.s[2]\n"
    "fmla v17.4s, v29.4s, v6.s[3]\n"
    "fmla v18.4s, v29.4s, v7.s[0]\n"
    "fmla v19.4s, v29.4s, v7.s[1]\n"
    "ldr q29, [%x[params], #0xc0]\n"
    "fmla v12.4s, v28.4s, v4.s[3]\n"
    "fmla v13.4s, v28.4s, v5.s[0]\n"
    "fmla v14.4s, v28.4s, v5.s[1]\n"
    "fmla v15.4s, v28.4s, v5.s[2]\n"
    "fmla v16.4s, v28.4s, v6.s[3]\n"
    "fmla v17.4s, v28.4s, v7.s[0]\n"
    "fmla v18.4s, v28.4s, v7.s[1]\n"
    "fmla v19.4s, v28.4s, v7.s[2]\n"
    "ldr q28, [%x[params], #0xd0]\n"
    "fmla v12.4s, v27.4s, v5.s[0]\n"
    "fmla v13.4s, v27.4s, v5.s[1]\n"
    "fmla v14.4s, v27.4s, v5.s[2]\n"
    "fmla v15.4s, v27.4s, v5.s[3]\n"
    "fmla v16.4s, v27.4s, v7.s[0]\n"
    "fmla v17.4s, v27.4s, v7.s[1]\n"
    "fmla v18.4s, v27.4s, v7.s[2]\n"
    "fmla v19.4s, v27.4s, v7.s[3]\n"
    "ldr q27, [%x[params], #0xe0]\n"
    "fmla v12.4s, v31.4s, v6.s[0]\n"
    "fmla v13.4s, v31.4s, v6.s[1]\n"
    "fmla v14.4s, v31.4s, v6.s[2]\n"
    "fmla v15.4s, v31.4s, v6.s[3]\n"
    "fmla v16.4s, v31.4s, v8.s[0]\n"
    "fmla v17.4s, v31.4s, v8.s[1]\n"
    "fmla v18.4s, v31.4s, v8.s[2]\n"
    "fmla v19.4s, v31.4s, v8.s[3]\n"
    "ldr q31, [%x[params], #0xf0]\n"
    "fmla v12.4s, v30.4s, v6.s[1]\n"
    "fmla v13.4s, v30.4s, v6.s[2]\n"
    "fmla v14.4s, v30.4s, v6.s[3]\n"
    "fmla v15.4s, v30.4s, v7.s[0]\n"
    "fmla v16.4s, v30.4s, v8.s[1]\n"
    "fmla v17.4s, v30.4s, v8.s[2]\n"
    "fmla v18.4s, v30.4s, v8.s[3]\n"
    "fmla v19.4s, v30.4s, v9.s[0]\n"
    "ldr q30, [%x[params], #0x100]\n"
    "fmla v12.4s, v29.4s, v6.s[2]\n"
    "fmla v13.4s, v29.4s, v6.s[3]\n"
    "fmla v14.4s, v29.4s, v7.s[0]\n"
    "fmla v15.4s, v29.4s, v7.s[1]\n"
    "fmla v16.4s, v29.4s, v8.s[2]\n"
    "fmla v17.4s, v29.4s, v8.s[3]\n"
    "fmla v18.4s, v29.4s, v9.s[0]\n"
    "fmla v19.4s, v29.4s, v9.s[1]\n"
    "ldr q29, [%x[params], #0x110]\n"
    "fmla v12.4s, v28.4s, v6.s[3]\n"
    "fmla v13.4s, v28.4s, v7.s[0]\n"
    "fmla v14.4s, v28.4s, v7.s[1]\n"
    "fmla v15.4s, v28.4s, v7.s[2]\n"
    "fmla v16.4s, v28.4s, v8.s[3]\n"
    "fmla v17.4s, v28.4s, v9.s[0]\n"
    "fmla v18.4s, v28.4s, v9.s[1]\n"
    "fmla v19.4s, v28.4s, v9.s[2]\n"
    "ldr q28, [%x[params], #0x120]\n"
    "fmla v12.4s, v27.4s, v7.s[0]\n"
    "fmla v13.4s, v27.4s, v7.s[1]\n"
    "fmla v14.4s, v27.4s, v7.s[2]\n"
    "fmla v15.4s, v27.4s, v7.s[3]\n"
    "fmla v16.4s, v27.4s, v9.s[0]\n"
    "fmla v17.4s, v27.4s, v9.s[1]\n"
    "fmla v18.4s, v27.4s, v9.s[2]\n"
    "fmla v19.4s, v27.4s, v9.s[3]\n"
    "ldr q27, [%x[params], #0x130]\n"
    "fmla v12.4s, v31.4s, v8.s[0]\n"
    "fmla v13.4s, v31.4s, v8.s[1]\n"
    "fmla v14.4s, v31.4s, v8.s[2]\n"
    "fmla v15.4s, v31.4s, v8.s[3]\n"
    "fmla v16.4s, v31.4s, v10.s[0]\n"
    "fmla v17.4s, v31.4s, v10.s[1]\n"
    "fmla v18.4s, v31.4s, v10.s[2]\n"
    "fmla v19.4s, v31.4s, v10.s[3]\n"
    "ldr q31, [%x[params], #0x150]\n"
    "fmla v12.4s, v30.4s, v8.s[1]\n"
    "fmla v13.4s, v30.4s, v8.s[2]\n"
    "fmla v14.4s, v30.4s, v8.s[3]\n"
    "fmla v15.4s, v30.4s, v9.s[0]\n"
    "fmla v16.4s, v30.4s, v10.s[1]\n"
    "fmla v17.4s, v30.4s, v10.s[2]\n"
    "fmla v18.4s, v30.4s, v10.s[3]\n"
    "fmla v19.4s, v30.4s, v11.s[0]\n"
    "ldr q30, [%x[params], #0x160]\n"
    "fmla v12.4s, v29.4s, v8.s[2]\n"
    "fmla v13.4s, v29.4s, v8.s[3]\n"
    "fmla v14.4s, v29.4s, v9.s[0]\n"
    "fmla v15.4s, v29.4s, v9.s[1]\n"
    "fmla v16.4s, v29.4s, v10.s[2]\n"
    "fmla v17.4s, v29.4s, v10.s[3]\n"
    "fmla v18.4s, v29.4s, v11.s[0]\n"
    "fmla v19.4s, v29.4s, v11.s[1]\n"
    "ldr q29, [%x[params], #0x170]\n"
    "fmla v12.4s, v28.4s, v8.s[3]\n"
    "fmla v13.4s, v28.4s, v9.s[0]\n"
    "fmla v14.4s, v28.4s, v9.s[1]\n"
    "fmla v15.4s, v28.4s, v9.s[2]\n"
    "fmla v16.4s, v28.4s, v10.s[3]\n"
    "fmla v17.4s, v28.4s, v11.s[0]\n"
    "fmla v18.4s, v28.4s, v11.s[1]\n"
    "fmla v19.4s, v28.4s, v11.s[2]\n"
    "ldr q28, [%x[params], #0x180]\n"
    "fmla v12.4s, v27.4s, v9.s[0]\n"
    "fmla v13.4s, v27.4s, v9.s[1]\n"
    "fmla v14.4s, v27.4s, v9.s[2]\n"
    "fmla v15.4s, v27.4s, v9.s[3]\n"
    "fmla v16.4s, v27.4s, v11.s[0]\n"
    "fmla v17.4s, v27.4s, v11.s[1]\n"
    "fmla v18.4s, v27.4s, v11.s[2]\n"
    "fmla v19.4s, v27.4s, v11.s[3]\n"
    "ldr q27, [%x[params], #0x190]\n"
    "fmin v12.4s, v12.4s, v20.4s\n"
    "fmin v13.4s, v13.4s, v20.4s\n"
    "fmin v14.4s, v14.4s, v20.4s\n"
    "fmax v12.4s, v12.4s, v21.4s\n"
    "str q12, [x13, x25]\n"
    "fmax v13.4s, v13.4s, v21.4s\n"
    "fmax v14.4s, v14.4s, v21.4s\n"
    "ldr q12, [%x[params], #0x140]\n"
    "add %x[params], %x[params], #0x1a0\n"
    "fmin v15.4s, v15.4s, v20.4s\n"
    "str q13, [x12, x25]\n"
    "fmin v16.4s, v16.4s, v20.4s\n"
    "fmin v17.4s, v17.4s, v20.4s\n"
    "str q14, [x10, x25]\n"
    "fmin v18.4s, v18.4s, v20.4s\n"
    "fmax v15.4s, v15.4s, v21.4s\n"
    "str q15, [x9, x25]\n"
    "fmax v16.4s, v16.4s, v21.4s\n"
    "fmax v17.4s, v17.4s, v21.4s\n"
    "str q16, [x27, x25]\n"
    "fmax v18.4s, v18.4s, v21.4s\n"
    "fmin v19.4s, v19.4s, v20.4s\n"
    "str q17, [x26, x25]\n"
    "mov v13.16b, v12.16b\n"
    "str q18, [x24, x25]\n"
    "fmax v19.4s, v19.4s, v21.4s\n"
    "mov v14.16b, v12.16b\n"
    "str q19, [x23, x25]\n"
    "mov v15.16b, v12.16b\n"
    "add x25, x25, #0x10\n"
    "mov v16.16b, v12.16b\n"
    "mov v17.16b, v12.16b\n"
    "mov v18.16b, v12.16b\n"
    "mov v19.16b, v12.16b\n"
    "bgt 1b\n"
    "2:"  // Output channel complete vector tail
    "fmla v12.4s, v31.4s, v0.s[0]\n"
    "fmla v13.4s, v31.4s, v0.s[1]\n"
    "fmla v14.4s, v31.4s, v0.s[2]\n"
    "fmla v15.4s, v31.4s, v0.s[3]\n"
    "fmla v16.4s, v31.4s, v2.s[0]\n"
    "fmla v17.4s, v31.4s, v2.s[1]\n"
    "fmla v18.4s, v31.4s, v2.s[2]\n"
    "fmla v19.4s, v31.4s, v2.s[3]\n"
    "ldr q31, [%x[params], #0x0]\n"
    "fmla v12.4s, v30.4s, v0.s[1]\n"
    "fmla v13.4s, v30.4s, v0.s[2]\n"
    "fmla v14.4s, v30.4s, v0.s[3]\n"
    "fmla v15.4s, v30.4s, v1.s[0]\n"
    "fmla v16.4s, v30.4s, v2.s[1]\n"
    "fmla v17.4s, v30.4s, v2.s[2]\n"
    "fmla v18.4s, v30.4s, v2.s[3]\n"
    "fmla v19.4s, v30.4s, v3.s[0]\n"
    "ldr q30, [%x[params], #0x10]\n"
    "fmla v12.4s, v29.4s, v0.s[2]\n"
    "fmla v13.4s, v29.4s, v0.s[3]\n"
    "fmla v14.4s, v29.4s, v1.s[0]\n"
    "fmla v15.4s, v29.4s, v1.s[1]\n"
    "fmla v16.4s, v29.4s, v2.s[2]\n"
    "fmla v17.4s, v29.4s, v2.s[3]\n"
    "fmla v18.4s, v29.4s, v3.s[0]\n"
    "fmla v19.4s, v29.4s, v3.s[1]\n"
    "ldr q29, [%x[params], #0x20]\n"
    "fmla v12.4s, v28.4s, v0.s[3]\n"
    "fmla v13.4s, v28.4s, v1.s[0]\n"
    "fmla v14.4s, v28.4s, v1.s[1]\n"
    "fmla v15.4s, v28.4s, v1.s[2]\n"
    "fmla v16.4s, v28.4s, v2.s[3]\n"
    "fmla v17.4s, v28.4s, v3.s[0]\n"
    "fmla v18.4s, v28.4s, v3.s[1]\n"
    "fmla v19.4s, v28.4s, v3.s[2]\n"
    "ldr q28, [%x[params], #0x30]\n"
    "fmla v12.4s, v27.4s, v1.s[0]\n"
    "fmla v13.4s, v27.4s, v1.s[1]\n"
    "fmla v14.4s, v27.4s, v1.s[2]\n"
    "fmla v15.4s, v27.4s, v1.s[3]\n"
    "fmla v16.4s, v27.4s, v3.s[0]\n"
    "fmla v17.4s, v27.4s, v3.s[1]\n"
    "fmla v18.4s, v27.4s, v3.s[2]\n"
    "fmla v19.4s, v27.4s, v3.s[3]\n"
    "ldr q27, [%x[params], #0x40]\n"
    "fmla v12.4s, v31.4s, v2.s[0]\n"
    "fmla v13.4s, v31.4s, v2.s[1]\n"
    "fmla v14.4s, v31.4s, v2.s[2]\n"
    "fmla v15.4s, v31.4s, v2.s[3]\n"
    "fmla v16.4s, v31.4s, v4.s[0]\n"
    "fmla v17.4s, v31.4s, v4.s[1]\n"
    "fmla v18.4s, v31.4s, v4.s[2]\n"
    "fmla v19.4s, v31.4s, v4.s[3]\n"
    "ldr q31, [%x[params], #0x50]\n"
    "fmla v12.4s, v30.4s, v2.s[1]\n"
    "fmla v13.4s, v30.4s, v2.s[2]\n"
    "fmla v14.4s, v30.4s, v2.s[3]\n"
    "fmla v15.4s, v30.4s, v3.s[0]\n"
    "fmla v16.4s, v30.4s, v4.s[1]\n"
    "fmla v17.4s, v30.4s, v4.s[2]\n"
    "fmla v18.4s, v30.4s, v4.s[3]\n"
    "fmla v19.4s, v30.4s, v5.s[0]\n"
    "ldr q30, [%x[params], #0x60]\n"
    "fmla v12.4s, v29.4s, v2.s[2]\n"
    "fmla v13.4s, v29.4s, v2.s[3]\n"
    "fmla v14.4s, v29.4s, v3.s[0]\n"
    "fmla v15.4s, v29.4s, v3.s[1]\n"
    "fmla v16.4s, v29.4s, v4.s[2]\n"
    "fmla v17.4s, v29.4s, v4.s[3]\n"
    "fmla v18.4s, v29.4s, v5.s[0]\n"
    "fmla v19.4s, v29.4s, v5.s[1]\n"
    "ldr q29, [%x[params], #0x70]\n"
    "fmla v12.4s, v28.4s, v2.s[3]\n"
    "fmla v13.4s, v28.4s, v3.s[0]\n"
    "fmla v14.4s, v28.4s, v3.s[1]\n"
    "fmla v15.4s, v28.4s, v3.s[2]\n"
    "fmla v16.4s, v28.4s, v4.s[3]\n"
    "fmla v17.4s, v28.4s, v5.s[0]\n"
    "fmla v18.4s, v28.4s, v5.s[1]\n"
    "fmla v19.4s, v28.4s, v5.s[2]\n"
    "ldr q28, [%x[params], #0x80]\n"
    "fmla v12.4s, v27.4s, v3.s[0]\n"
    "fmla v13.4s, v27.4s, v3.s[1]\n"
    "fmla v14.4s, v27.4s, v3.s[2]\n"
    "fmla v15.4s, v27.4s, v3.s[3]\n"
    "fmla v16.4s, v27.4s, v5.s[0]\n"
    "fmla v17.4s, v27.4s, v5.s[1]\n"
    "fmla v18.4s, v27.4s, v5.s[2]\n"
    "fmla v19.4s, v27.4s, v5.s[3]\n"
    "ldr q27, [%x[params], #0x90]\n"
    "fmla v12.4s, v31.4s, v4.s[0]\n"
    "fmla v13.4s, v31.4s, v4.s[1]\n"
    "fmla v14.4s, v31.4s, v4.s[2]\n"
    "fmla v15.4s, v31.4s, v4.s[3]\n"
    "fmla v16.4s, v31.4s, v6.s[0]\n"
    "fmla v17.4s, v31.4s, v6.s[1]\n"
    "fmla v18.4s, v31.4s, v6.s[2]\n"
    "fmla v19.4s, v31.4s, v6.s[3]\n"
    "ldr q31, [%x[params], #0xa0]\n"
    "fmla v12.4s, v30.4s, v4.s[1]\n"
    "fmla v13.4s, v30.4s, v4.s[2]\n"
    "fmla v14.4s, v30.4s, v4.s[3]\n"
    "fmla v15.4s, v30.4s, v5.s[0]\n"
    "fmla v16.4s, v30.4s, v6.s[1]\n"
    "fmla v17.4s, v30.4s, v6.s[2]\n"
    "fmla v18.4s, v30.4s, v6.s[3]\n"
    "fmla v19.4s, v30.4s, v7.s[0]\n"
    "ldr q30, [%x[params], #0xb0]\n"
    "fmla v12.4s, v29.4s, v4.s[2]\n"
    "fmla v13.4s, v29.4s, v4.s[3]\n"
    "fmla v14.4s, v29.4s, v5.s[0]\n"
    "fmla v15.4s, v29.4s, v5.s[1]\n"
    "fmla v16.4s, v29.4s, v6.s[2]\n"
    "fmla v17.4s, v29.4s, v6.s[3]\n"
    "fmla v18.4s, v29.4s, v7.s[0]\n"
    "fmla v19.4s, v29.4s, v7.s[1]\n"
    "ldr q29, [%x[params], #0xc0]\n"
    "fmla v12.4s, v28.4s, v4.s[3]\n"
    "fmla v13.4s, v28.4s, v5.s[0]\n"
    "fmla v14.4s, v28.4s, v5.s[1]\n"
    "fmla v15.4s, v28.4s, v5.s[2]\n"
    "fmla v16.4s, v28.4s, v6.s[3]\n"
    "fmla v17.4s, v28.4s, v7.s[0]\n"
    "fmla v18.4s, v28.4s, v7.s[1]\n"
    "fmla v19.4s, v28.4s, v7.s[2]\n"
    "ldr q28, [%x[params], #0xd0]\n"
    "fmla v12.4s, v27.4s, v5.s[0]\n"
    "fmla v13.4s, v27.4s, v5.s[1]\n"
    "fmla v14.4s, v27.4s, v5.s[2]\n"
    "fmla v15.4s, v27.4s, v5.s[3]\n"
    "fmla v16.4s, v27.4s, v7.s[0]\n"
    "fmla v17.4s, v27.4s, v7.s[1]\n"
    "fmla v18.4s, v27.4s, v7.s[2]\n"
    "fmla v19.4s, v27.4s, v7.s[3]\n"
    "ldr q27, [%x[params], #0xe0]\n"
    "fmla v12.4s, v31.4s, v6.s[0]\n"
    "fmla v13.4s, v31.4s, v6.s[1]\n"
    "fmla v14.4s, v31.4s, v6.s[2]\n"
    "fmla v15.4s, v31.4s, v6.s[3]\n"
    "fmla v16.4s, v31.4s, v8.s[0]\n"
    "fmla v17.4s, v31.4s, v8.s[1]\n"
    "fmla v18.4s, v31.4s, v8.s[2]\n"
    "fmla v19.4s, v31.4s, v8.s[3]\n"
    "ldr q31, [%x[params], #0xf0]\n"
    "fmla v12.4s, v30.4s, v6.s[1]\n"
    "fmla v13.4s, v30.4s, v6.s[2]\n"
    "fmla v14.4s, v30.4s, v6.s[3]\n"
    "fmla v15.4s, v30.4s, v7.s[0]\n"
    "fmla v16.4s, v30.4s, v8.s[1]\n"
    "fmla v17.4s, v30.4s, v8.s[2]\n"
    "fmla v18.4s, v30.4s, v8.s[3]\n"
    "fmla v19.4s, v30.4s, v9.s[0]\n"
    "ldr q30, [%x[params], #0x100]\n"
    "fmla v12.4s, v29.4s, v6.s[2]\n"
    "fmla v13.4s, v29.4s, v6.s[3]\n"
    "fmla v14.4s, v29.4s, v7.s[0]\n"
    "fmla v15.4s, v29.4s, v7.s[1]\n"
    "fmla v16.4s, v29.4s, v8.s[2]\n"
    "fmla v17.4s, v29.4s, v8.s[3]\n"
    "fmla v18.4s, v29.4s, v9.s[0]\n"
    "fmla v19.4s, v29.4s, v9.s[1]\n"
    "ldr q29, [%x[params], #0x110]\n"
    "fmla v12.4s, v28.4s, v6.s[3]\n"
    "fmla v13.4s, v28.4s, v7.s[0]\n"
    "fmla v14.4s, v28.4s, v7.s[1]\n"
    "fmla v15.4s, v28.4s, v7.s[2]\n"
    "fmla v16.4s, v28.4s, v8.s[3]\n"
    "fmla v17.4s, v28.4s, v9.s[0]\n"
    "fmla v18.4s, v28.4s, v9.s[1]\n"
    "fmla v19.4s, v28.4s, v9.s[2]\n"
    "ldr q28, [%x[params], #0x120]\n"
    "fmla v12.4s, v27.4s, v7.s[0]\n"
    "fmla v13.4s, v27.4s, v7.s[1]\n"
    "fmla v14.4s, v27.4s, v7.s[2]\n"
    "fmla v15.4s, v27.4s, v7.s[3]\n"
    "fmla v16.4s, v27.4s, v9.s[0]\n"
    "fmla v17.4s, v27.4s, v9.s[1]\n"
    "fmla v18.4s, v27.4s, v9.s[2]\n"
    "fmla v19.4s, v27.4s, v9.s[3]\n"
    "ldr q27, [%x[params], #0x130]\n"
    "add %x[params], %x[params], #0x140\n"
    "fmla v12.4s, v31.4s, v8.s[0]\n"
    "fmla v13.4s, v31.4s, v8.s[1]\n"
    "fmla v14.4s, v31.4s, v8.s[2]\n"
    "fmla v15.4s, v31.4s, v8.s[3]\n"
    "fmla v16.4s, v31.4s, v10.s[0]\n"
    "fmla v17.4s, v31.4s, v10.s[1]\n"
    "fmla v18.4s, v31.4s, v10.s[2]\n"
    "fmla v19.4s, v31.4s, v10.s[3]\n"
    "fmla v12.4s, v30.4s, v8.s[1]\n"
    "fmla v13.4s, v30.4s, v8.s[2]\n"
    "fmla v14.4s, v30.4s, v8.s[3]\n"
    "fmla v15.4s, v30.4s, v9.s[0]\n"
    "fmla v16.4s, v30.4s, v10.s[1]\n"
    "fmla v17.4s, v30.4s, v10.s[2]\n"
    "fmla v18.4s, v30.4s, v10.s[3]\n"
    "fmla v19.4s, v30.4s, v11.s[0]\n"
    "fmla v12.4s, v29.4s, v8.s[2]\n"
    "fmla v13.4s, v29.4s, v8.s[3]\n"
    "fmla v14.4s, v29.4s, v9.s[0]\n"
    "fmla v15.4s, v29.4s, v9.s[1]\n"
    "fmla v16.4s, v29.4s, v10.s[2]\n"
    "fmla v17.4s, v29.4s, v10.s[3]\n"
    "fmla v18.4s, v29.4s, v11.s[0]\n"
    "fmla v19.4s, v29.4s, v11.s[1]\n"
    "fmla v12.4s, v28.4s, v8.s[3]\n"
    "fmla v13.4s, v28.4s, v9.s[0]\n"
    "fmla v14.4s, v28.4s, v9.s[1]\n"
    "fmla v15.4s, v28.4s, v9.s[2]\n"
    "fmla v16.4s, v28.4s, v10.s[3]\n"
    "fmla v17.4s, v28.4s, v11.s[0]\n"
    "fmla v18.4s, v28.4s, v11.s[1]\n"
    "fmla v19.4s, v28.4s, v11.s[2]\n"
    "fmla v12.4s, v27.4s, v9.s[0]\n"
    "fmla v13.4s, v27.4s, v9.s[1]\n"
    "fmla v14.4s, v27.4s, v9.s[2]\n"
    "fmla v15.4s, v27.4s, v9.s[3]\n"
    "fmla v16.4s, v27.4s, v11.s[0]\n"
    "fmla v17.4s, v27.4s, v11.s[1]\n"
    "fmla v18.4s, v27.4s, v11.s[2]\n"
    "fmla v19.4s, v27.4s, v11.s[3]\n"
    "fmin v12.4s, v12.4s, v20.4s\n"
    "fmin v13.4s, v13.4s, v20.4s\n"
    "fmin v14.4s, v14.4s, v20.4s\n"
    "fmax v12.4s, v12.4s, v21.4s\n"
    "str q12, [x13, x25]\n"
    "fmax v13.4s, v13.4s, v21.4s\n"
    "fmax v14.4s, v14.4s, v21.4s\n"
    "str q13, [x12, x25]\n"
    "fmin v15.4s, v15.4s, v20.4s\n"
    "fmin v16.4s, v16.4s, v20.4s\n"
    "str q14, [x10, x25]\n"
    "fmin v17.4s, v17.4s, v20.4s\n"
    "fmin v18.4s, v18.4s, v20.4s\n"
    "fmax v15.4s, v15.4s, v21.4s\n"
    "str q15, [x9, x25]\n"
    "fmax v16.4s, v16.4s, v21.4s\n"
    "fmax v17.4s, v17.4s, v21.4s\n"
    "str q16, [x27, x25]\n"
    "fmax v18.4s, v18.4s, v21.4s\n"
    "fmin v19.4s, v19.4s, v20.4s\n"
    "str q17, [x26, x25]\n"
    "fmax v19.4s, v19.4s, v21.4s\n"
    "str q18, [x24, x25]\n"
    "str q19, [x23, x25]\n"
    "add x25, x25, #0x10\n"
    "3:"  // Output channel oddments
    "tst %x[channel_multiplier], #0x3\n"
    "beq 6f\n"
    "ldr q12, [%x[params], #0x0]\n"
    "mov v13.16b, v12.16b\n"
    "ldr q31, [%x[params], #0x10]\n"
    "mov v14.16b, v12.16b\n"
    "ldr q30, [%x[params], #0x20]\n"
    "mov v15.16b, v12.16b\n"
    "ldr q29, [%x[params], #0x30]\n"
    "mov v16.16b, v12.16b\n"
    "ldr q28, [%x[params], #0x40]\n"
    "mov v17.16b, v12.16b\n"
    "ldr q27, [%x[params], #0x50]\n"
    "mov v18.16b, v12.16b\n"
    "mov v19.16b, v12.16b\n"
    "fmla v12.4s, v31.4s, v0.s[0]\n"
    "fmla v13.4s, v31.4s, v0.s[1]\n"
    "fmla v14.4s, v31.4s, v0.s[2]\n"
    "fmla v15.4s, v31.4s, v0.s[3]\n"
    "fmla v16.4s, v31.4s, v2.s[0]\n"
    "fmla v17.4s, v31.4s, v2.s[1]\n"
    "fmla v18.4s, v31.4s, v2.s[2]\n"
    "fmla v19.4s, v31.4s, v2.s[3]\n"
    "ldr q31, [%x[params], #0x60]\n"
    "fmla v12.4s, v30.4s, v0.s[1]\n"
    "fmla v13.4s, v30.4s, v0.s[2]\n"
    "fmla v14.4s, v30.4s, v0.s[3]\n"
    "fmla v15.4s, v30.4s, v1.s[0]\n"
    "fmla v16.4s, v30.4s, v2.s[1]\n"
    "fmla v17.4s, v30.4s, v2.s[2]\n"
    "fmla v18.4s, v30.4s, v2.s[3]\n"
    "fmla v19.4s, v30.4s, v3.s[0]\n"
    "ldr q30, [%x[params], #0x70]\n"
    "fmla v12.4s, v29.4s, v0.s[2]\n"
    "fmla v13.4s, v29.4s, v0.s[3]\n"
    "fmla v14.4s, v29.4s, v1.s[0]\n"
    "fmla v15.4s, v29.4s, v1.s[1]\n"
    "fmla v16.4s, v29.4s, v2.s[2]\n"
    "fmla v17.4s, v29.4s, v2.s[3]\n"
    "fmla v18.4s, v29.4s, v3.s[0]\n"
    "fmla v19.4s, v29.4s, v3.s[1]\n"
    "ldr q29, [%x[params], #0x80]\n"
    "fmla v12.4s, v28.4s, v0.s[3]\n"
    "fmla v13.4s, v28.4s, v1.s[0]\n"
    "fmla v14.4s, v28.4s, v1.s[1]\n"
    "fmla v15.4s, v28.4s, v1.s[2]\n"
    "fmla v16.4s, v28.4s, v2.s[3]\n"
    "fmla v17.4s, v28.4s, v3.s[0]\n"
    "fmla v18.4s, v28.4s, v3.s[1]\n"
    "fmla v19.4s, v28.4s, v3.s[2]\n"
    "ldr q28, [%x[params], #0x90]\n"
    "fmla v12.4s, v27.4s, v1.s[0]\n"
    "fmla v13.4s, v27.4s, v1.s[1]\n"
    "fmla v14.4s, v27.4s, v1.s[2]\n"
    "fmla v15.4s, v27.4s, v1.s[3]\n"
    "fmla v16.4s, v27.4s, v3.s[0]\n"
    "fmla v17.4s, v27.4s, v3.s[1]\n"
    "fmla v18.4s, v27.4s, v3.s[2]\n"
    "fmla v19.4s, v27.4s, v3.s[3]\n"
    "ldr q27, [%x[params], #0xa0]\n"
    "fmla v12.4s, v31.4s, v2.s[0]\n"
    "fmla v13.4s, v31.4s, v2.s[1]\n"
    "fmla v14.4s, v31.4s, v2.s[2]\n"
    "fmla v15.4s, v31.4s, v2.s[3]\n"
    "fmla v16.4s, v31.4s, v4.s[0]\n"
    "fmla v17.4s, v31.4s, v4.s[1]\n"
    "fmla v18.4s, v31.4s, v4.s[2]\n"
    "fmla v19.4s, v31.4s, v4.s[3]\n"
    "ldr q31, [%x[params], #0xb0]\n"
    "fmla v12.4s, v30.4s, v2.s[1]\n"
    "fmla v13.4s, v30.4s, v2.s[2]\n"
    "fmla v14.4s, v30.4s, v2.s[3]\n"
    "fmla v15.4s, v30.4s, v3.s[0]\n"
    "fmla v16.4s, v30.4s, v4.s[1]\n"
    "fmla v17.4s, v30.4s, v4.s[2]\n"
    "fmla v18.4s, v30.4s, v4.s[3]\n"
    "fmla v19.4s, v30.4s, v5.s[0]\n"
    "ldr q30, [%x[params], #0xc0]\n"
    "fmla v12.4s, v29.4s, v2.s[2]\n"
    "fmla v13.4s, v29.4s, v2.s[3]\n"
    "fmla v14.4s, v29.4s, v3.s[0]\n"
    "fmla v15.4s, v29.4s, v3.s[1]\n"
    "fmla v16.4s, v29.4s, v4.s[2]\n"
    "fmla v17.4s, v29.4s, v4.s[3]\n"
    "fmla v18.4s, v29.4s, v5.s[0]\n"
    "fmla v19.4s, v29.4s, v5.s[1]\n"
    "ldr q29, [%x[params], #0xd0]\n"
    "fmla v12.4s, v28.4s, v2.s[3]\n"
    "fmla v13.4s, v28.4s, v3.s[0]\n"
    "fmla v14.4s, v28.4s, v3.s[1]\n"
    "fmla v15.4s, v28.4s, v3.s[2]\n"
    "fmla v16.4s, v28.4s, v4.s[3]\n"
    "fmla v17.4s, v28.4s, v5.s[0]\n"
    "fmla v18.4s, v28.4s, v5.s[1]\n"
    "fmla v19.4s, v28.4s, v5.s[2]\n"
    "ldr q28, [%x[params], #0xe0]\n"
    "fmla v12.4s, v27.4s, v3.s[0]\n"
    "fmla v13.4s, v27.4s, v3.s[1]\n"
    "fmla v14.4s, v27.4s, v3.s[2]\n"
    "fmla v15.4s, v27.4s, v3.s[3]\n"
    "fmla v16.4s, v27.4s, v5.s[0]\n"
    "fmla v17.4s, v27.4s, v5.s[1]\n"
    "fmla v18.4s, v27.4s, v5.s[2]\n"
    "fmla v19.4s, v27.4s, v5.s[3]\n"
    "ldr q27, [%x[params], #0xf0]\n"
    "fmla v12.4s, v31.4s, v4.s[0]\n"
    "fmla v13.4s, v31.4s, v4.s[1]\n"
    "fmla v14.4s, v31.4s, v4.s[2]\n"
    "fmla v15.4s, v31.4s, v4.s[3]\n"
    "fmla v16.4s, v31.4s, v6.s[0]\n"
    "fmla v17.4s, v31.4s, v6.s[1]\n"
    "fmla v18.4s, v31.4s, v6.s[2]\n"
    "fmla v19.4s, v31.4s, v6.s[3]\n"
    "ldr q31, [%x[params], #0x100]\n"
    "fmla v12.4s, v30.4s, v4.s[1]\n"
    "fmla v13.4s, v30.4s, v4.s[2]\n"
    "fmla v14.4s, v30.4s, v4.s[3]\n"
    "fmla v15.4s, v30.4s, v5.s[0]\n"
    "fmla v16.4s, v30.4s, v6.s[1]\n"
    "fmla v17.4s, v30.4s, v6.s[2]\n"
    "fmla v18.4s, v30.4s, v6.s[3]\n"
    "fmla v19.4s, v30.4s, v7.s[0]\n"
    "ldr q30, [%x[params], #0x110]\n"
    "fmla v12.4s, v29.4s, v4.s[2]\n"
    "fmla v13.4s, v29.4s, v4.s[3]\n"
    "fmla v14.4s, v29.4s, v5.s[0]\n"
    "fmla v15.4s, v29.4s, v5.s[1]\n"
    "fmla v16.4s, v29.4s, v6.s[2]\n"
    "fmla v17.4s, v29.4s, v6.s[3]\n"
    "fmla v18.4s, v29.4s, v7.s[0]\n"
    "fmla v19.4s, v29.4s, v7.s[1]\n"
    "ldr q29, [%x[params], #0x120]\n"
    "fmla v12.4s, v28.4s, v4.s[3]\n"
    "fmla v13.4s, v28.4s, v5.s[0]\n"
    "fmla v14.4s, v28.4s, v5.s[1]\n"
    "fmla v15.4s, v28.4s, v5.s[2]\n"
    "fmla v16.4s, v28.4s, v6.s[3]\n"
    "fmla v17.4s, v28.4s, v7.s[0]\n"
    "fmla v18.4s, v28.4s, v7.s[1]\n"
    "fmla v19.4s, v28.4s, v7.s[2]\n"
    "ldr q28, [%x[params], #0x130]\n"
    "fmla v12.4s, v27.4s, v5.s[0]\n"
    "fmla v13.4s, v27.4s, v5.s[1]\n"
    "fmla v14.4s, v27.4s, v5.s[2]\n"
    "fmla v15.4s, v27.4s, v5.s[3]\n"
    "fmla v16.4s, v27.4s, v7.s[0]\n"
    "fmla v17.4s, v27.4s, v7.s[1]\n"
    "fmla v18.4s, v27.4s, v7.s[2]\n"
    "fmla v19.4s, v27.4s, v7.s[3]\n"
    "ldr q27, [%x[params], #0x140]\n"
    "fmla v12.4s, v31.4s, v6.s[0]\n"
    "fmla v13.4s, v31.4s, v6.s[1]\n"
    "fmla v14.4s, v31.4s, v6.s[2]\n"
    "fmla v15.4s, v31.4s, v6.s[3]\n"
    "fmla v16.4s, v31.4s, v8.s[0]\n"
    "fmla v17.4s, v31.4s, v8.s[1]\n"
    "fmla v18.4s, v31.4s, v8.s[2]\n"
    "fmla v19.4s, v31.4s, v8.s[3]\n"
    "ldr q31, [%x[params], #0x150]\n"
    "fmla v12.4s, v30.4s, v6.s[1]\n"
    "fmla v13.4s, v30.4s, v6.s[2]\n"
    "fmla v14.4s, v30.4s, v6.s[3]\n"
    "fmla v15.4s, v30.4s, v7.s[0]\n"
    "fmla v16.4s, v30.4s, v8.s[1]\n"
    "fmla v17.4s, v30.4s, v8.s[2]\n"
    "fmla v18.4s, v30.4s, v8.s[3]\n"
    "fmla v19.4s, v30.4s, v9.s[0]\n"
    "ldr q30, [%x[params], #0x160]\n"
    "fmla v12.4s, v29.4s, v6.s[2]\n"
    "fmla v13.4s, v29.4s, v6.s[3]\n"
    "fmla v14.4s, v29.4s, v7.s[0]\n"
    "fmla v15.4s, v29.4s, v7.s[1]\n"
    "fmla v16.4s, v29.4s, v8.s[2]\n"
    "fmla v17.4s, v29.4s, v8.s[3]\n"
    "fmla v18.4s, v29.4s, v9.s[0]\n"
    "fmla v19.4s, v29.4s, v9.s[1]\n"
    "ldr q29, [%x[params], #0x170]\n"
    "fmla v12.4s, v28.4s, v6.s[3]\n"
    "fmla v13.4s, v28.4s, v7.s[0]\n"
    "fmla v14.4s, v28.4s, v7.s[1]\n"
    "fmla v15.4s, v28.4s, v7.s[2]\n"
    "fmla v16.4s, v28.4s, v8.s[3]\n"
    "fmla v17.4s, v28.4s, v9.s[0]\n"
    "fmla v18.4s, v28.4s, v9.s[1]\n"
    "fmla v19.4s, v28.4s, v9.s[2]\n"
    "ldr q28, [%x[params], #0x180]\n"
    "fmla v12.4s, v27.4s, v7.s[0]\n"
    "fmla v13.4s, v27.4s, v7.s[1]\n"
    "fmla v14.4s, v27.4s, v7.s[2]\n"
    "fmla v15.4s, v27.4s, v7.s[3]\n"
    "fmla v16.4s, v27.4s, v9.s[0]\n"
    "fmla v17.4s, v27.4s, v9.s[1]\n"
    "fmla v18.4s, v27.4s, v9.s[2]\n"
    "fmla v19.4s, v27.4s, v9.s[3]\n"
    "ldr q27, [%x[params], #0x190]\n"
    "add %x[params], %x[params], #0x1a0\n"
    "fmla v12.4s, v31.4s, v8.s[0]\n"
    "fmla v13.4s, v31.4s, v8.s[1]\n"
    "fmla v14.4s, v31.4s, v8.s[2]\n"
    "fmla v15.4s, v31.4s, v8.s[3]\n"
    "fmla v16.4s, v31.4s, v10.s[0]\n"
    "fmla v17.4s, v31.4s, v10.s[1]\n"
    "fmla v18.4s, v31.4s, v10.s[2]\n"
    "fmla v19.4s, v31.4s, v10.s[3]\n"
    "fmla v12.4s, v30.4s, v8.s[1]\n"
    "fmla v13.4s, v30.4s, v8.s[2]\n"
    "fmla v14.4s, v30.4s, v8.s[3]\n"
    "fmla v15.4s, v30.4s, v9.s[0]\n"
    "fmla v16.4s, v30.4s, v10.s[1]\n"
    "fmla v17.4s, v30.4s, v10.s[2]\n"
    "fmla v18.4s, v30.4s, v10.s[3]\n"
    "fmla v19.4s, v30.4s, v11.s[0]\n"
    "fmla v12.4s, v29.4s, v8.s[2]\n"
    "fmla v13.4s, v29.4s, v8.s[3]\n"
    "fmla v14.4s, v29.4s, v9.s[0]\n"
    "fmla v15.4s, v29.4s, v9.s[1]\n"
    "fmla v16.4s, v29.4s, v10.s[2]\n"
    "fmla v17.4s, v29.4s, v10.s[3]\n"
    "fmla v18.4s, v29.4s, v11.s[0]\n"
    "fmla v19.4s, v29.4s, v11.s[1]\n"
    "fmla v12.4s, v28.4s, v8.s[3]\n"
    "fmla v13.4s, v28.4s, v9.s[0]\n"
    "fmla v14.4s, v28.4s, v9.s[1]\n"
    "fmla v15.4s, v28.4s, v9.s[2]\n"
    "fmla v16.4s, v28.4s, v10.s[3]\n"
    "fmla v17.4s, v28.4s, v11.s[0]\n"
    "fmla v18.4s, v28.4s, v11.s[1]\n"
    "fmla v19.4s, v28.4s, v11.s[2]\n"
    "fmla v12.4s, v27.4s, v9.s[0]\n"
    "fmla v13.4s, v27.4s, v9.s[1]\n"
    "fmla v14.4s, v27.4s, v9.s[2]\n"
    "fmla v15.4s, v27.4s, v9.s[3]\n"
    "fmla v16.4s, v27.4s, v11.s[0]\n"
    "fmla v17.4s, v27.4s, v11.s[1]\n"
    "fmla v18.4s, v27.4s, v11.s[2]\n"
    "fmla v19.4s, v27.4s, v11.s[3]\n"
    "fmin v12.4s, v12.4s, v20.4s\n"
    "fmin v13.4s, v13.4s, v20.4s\n"
    "fmin v14.4s, v14.4s, v20.4s\n"
    "fmax v12.4s, v12.4s, v21.4s\n"
    "fmax v13.4s, v13.4s, v21.4s\n"
    "fmax v14.4s, v14.4s, v21.4s\n"
    "fmin v15.4s, v15.4s, v20.4s\n"
    "fmin v16.4s, v16.4s, v20.4s\n"
    "fmin v17.4s, v17.4s, v20.4s\n"
    "fmax v15.4s, v15.4s, v21.4s\n"
    "fmax v16.4s, v16.4s, v21.4s\n"
    "fmax v17.4s, v17.4s, v21.4s\n"
    "fmin v18.4s, v18.4s, v20.4s\n"
    "fmin v19.4s, v19.4s, v20.4s\n"
    "fmax v18.4s, v18.4s, v21.4s\n"
    "fmax v19.4s, v19.4s, v21.4s\n"
    "tbz %x[channel_multiplier], #1, 4f\n"
    "add x19, x13, x25\n"
    "st1 { v12.d }[0], [x19]\n"
    "add x19, x12, x25\n"
    "st1 { v13.d }[0], [x19]\n"
    "add x19, x10, x25\n"
    "st1 { v14.d }[0], [x19]\n"
    "add x19, x9, x25\n"
    "st1 { v15.d }[0], [x19]\n"
    "add x19, x27, x25\n"
    "st1 { v16.d }[0], [x19]\n"
    "add x19, x26, x25\n"
    "st1 { v17.d }[0], [x19]\n"
    "add x19, x24, x25\n"
    "st1 { v18.d }[0], [x19]\n"
    "add x19, x23, x25\n"
    "st1 { v19.d }[0], [x19]\n"
    "add x25, x25, #0x8\n"
    "tbz %x[channel_multiplier], #0, 5f\n"
    "add x19, x13, x25\n"
    "st1 { v12.s }[2], [x19]\n"
    "add x19, x12, x25\n"
    "st1 { v13.s }[2], [x19]\n"
    "add x19, x10, x25\n"
    "st1 { v14.s }[2], [x19]\n"
    "add x19, x9, x25\n"
    "st1 { v15.s }[2], [x19]\n"
    "add x19, x27, x25\n"
    "st1 { v16.s }[2], [x19]\n"
    "add x19, x26, x25\n"
    "st1 { v17.s }[2], [x19]\n"
    "add x19, x24, x25\n"
    "st1 { v18.s }[2], [x19]\n"
    "add x19, x23, x25\n"
    "st1 { v19.s }[2], [x19]\n"
    "b 5f\n"
    "4:"  // Output channel oddments: Store: Bit 1: Unset
    "tbz %x[channel_multiplier], #0, 5f\n"
    "add x19, x13, x25\n"
    "st1 { v12.s }[0], [x19]\n"
    "add x19, x12, x25\n"
    "st1 { v13.s }[0], [x19]\n"
    "add x19, x10, x25\n"
    "st1 { v14.s }[0], [x19]\n"
    "add x19, x9, x25\n"
    "st1 { v15.s }[0], [x19]\n"
    "add x19, x27, x25\n"
    "st1 { v16.s }[0], [x19]\n"
    "add x19, x26, x25\n"
    "st1 { v17.s }[0], [x19]\n"
    "add x19, x24, x25\n"
    "st1 { v18.s }[0], [x19]\n"
    "add x19, x23, x25\n"
    "st1 { v19.s }[0], [x19]\n"
    "5:"  // Output channel oddments: Store: Bit 1: End

    "6:"  // End

    : [params] "+&r" (params)
    : [channel_multiplier] "r" (n_output_channels), [clamps] "r" (minmax_vals), [inptrs] "r" (inptrs), [outptrs] "r" (outptrs)
    : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21", "v27", "v28", "v29", "v30", "v31", "x9", "x10", "x11", "x12", "x13", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28"
  );
}

}  // namespace depthwise
}  // namespace arm_conv
#endif // defined(__aarch64__)
